import React, { Component } from 'react'
import { connect } from 'react-redux'

// state它是一个immutable对象
// connect参数1:返回一个原生的js对象
@connect(state => state.get('num').toJS(), {
  add(n = 1) {
    return { type: 'add', data: n }
  }
})
class App extends Component {
  render() {
    return (
      <div>
        <h3>{this.props.count}</h3>
        <button onClick={() => this.props.add()}>+++</button>
      </div>
    )
  }
}

export default App
